package cn.lzy.web.Servlet;

import org.springframework.stereotype.Component;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

//@WebListener

// 自定义 Listener 类
@Component
public class MyListener implements ServletContextListener {     // 看到输出语句：contextDestroyed ...  单击图中的【Eixt】按钮
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        System.out.println("contextInitialized ..."); }
    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        System.out.println("contextDestroyed ...");  }

}
